<template>
  <div>
        <div class="udlite-container partners">
            <van-field v-model="password" label="密码" placeholder="请输入新密码" />
            <van-field v-model="password2" label="确认密码" placeholder="请确认新密码" />
            <van-button type="primary" @click="alter">确认</van-button>
        </div>
  </div>
</template>

<script>
export default {
    data() {
        return {
            password:'',
            password2:'',
            token:localStorage.getItem('token'),
            uid:localStorage.getItem('uid'),
            username:localStorage.getItem('username')
        }
    },

    methods:{
        alter(){
            this.axios.put('http://localhost:8000/login2/', this.qs.stringify({'password':this.password,
            'password2':this.password2,'token':this.token,'username':this.username,'uid':this.uid})).then(res=>{
                console.log(res.data)
                if (res.data.code==200){
                    this.$toast(res.data.message)
                }else{
                    this.$toast(res.data.message)
                }
            })
        }
    }
}
</script>

<style>

</style>